﻿using DtoFw;
using DtoFw.Query;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Mvc;
using Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SceneEvidenceAPI.Controllers
{
    /// <summary>
    /// 案件
    /// </summary>
    [Microsoft.AspNetCore.Mvc.Route("api/approve")]
    public class CasePhysicalApproveController : BaseController
    {
        private readonly CasePhysicalApproveService _approveService;
        public CasePhysicalApproveController(CasePhysicalApproveService _approveService)
        {
            this._approveService = _approveService;
        }
        /// <summary>
        /// 单个查询
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public BaseGenericResult<dynamic> Get([FromQuery] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.Get(reqDto);
        }
        /// <summary>
        /// 分页
        /// </summary>
        /// <returns></returns>
        [HttpPost("pager")]
        public BaseGenericResult<Pager<dynamic>> Pager([FromBody] CasePhysicalApproveReqDto queryDto)
        {
            return _approveService.Pager(queryDto);
        }
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public BaseResult Post([FromBody] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.Post(reqDto);
        }
        /// <summary>
        /// 编辑
        /// </summary>
        /// <returns></returns>
        [HttpPut]
        public BaseResult Put([FromBody] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.Put(reqDto);
        }
        /// <summary>
        /// 编辑
        /// </summary>
        /// <returns></returns>
        [HttpDelete]
        public BaseResult Delete([FromQuery] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.Delete(reqDto);
        }
        /// <summary>
        /// 审核
        /// </summary>
        [HttpPost("ApproveSubmit")]
        public BaseResult ApproveSubmit([FromQuery] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.Approvesubmit(reqDto);
        }
        /// <summary>
        /// 撤销
        /// </summary>
        [HttpPost("CancelApprove")]
        public BaseResult CancelApprove([FromQuery] CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.CancelApprove(reqDto);
        }
        /// <summary>
        /// 审核
        /// </summary>
        [HttpPost("queryApproveEvidence")]
        public BaseGenericResult<Pager<DtoFw.Result.CaseEvidencePagerRespDto>> QueryApproveEvidence([FromBody] EvidenceQueryReqDto reqDto)
        {
            return _approveService.QueryApproveEvidence(reqDto);
        }
        /// <summary>
        /// 检查物品审核状态
        /// </summary>
        [HttpPost("checkEvidenceAuditState")]
        public BaseGenericResult<object> CheckEvidenceAuditState([FromBody]CasePhysicalApproveReqDto reqDto)
        {
            return _approveService.CheckEvidenceAuditState(reqDto);
        }
        
    }
}
